package com.ccbooks.listener;

import com.ccbooks.view.BookContentView;
import com.ccbooks.view.R;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.SeekBar;
import android.widget.TextView;

public class BtnColorBlackClick implements OnClickListener{

	private BookContentView bcv;
	private LinearLayout bookpagebg;  //竖屏书背景；
	private Button btnFontEnterButtona1; //字体变小按钮；
	private Button btnFontEnterButtonA2; //字体变大按钮；	
	private Button btnFontEnterColorBrown; //棕色背景按钮；

	// 点击字体按钮；

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if (bcv.portraint == 1) {
			if(bcv.showColorBlack==1){
				
				((Button)v).setBackgroundResource(R.drawable.content_btn_color_black_selected);
				btnFontEnterButtona1.setBackgroundResource(R.drawable.content_btn_font_enter_a);
				btnFontEnterButtonA2.setBackgroundResource(R.drawable.content_btn_font_enter_b);
				btnFontEnterColorBrown.setBackgroundResource(R.drawable.content_btn_color_brown);
				bookpagebg.setBackgroundResource(R.drawable.bookpagebg);
				bcv.showColorBlack=2;
				bcv.showFontEnterButtona1=1;
				bcv.showFontEnterButtonA2=1;
			}else{
				((Button)v).setBackgroundResource(R.drawable.content_btn_color_black);
				bcv.showColorBlack=1;
			}
		} else if (bcv.portraint == 2) {
			if(bcv.showColorBlack==1){
				
				((Button)v).setBackgroundResource(R.drawable.content_btn_color_black_selected);
				btnFontEnterButtona1.setBackgroundResource(R.drawable.content_btn_font_enter_a);
				btnFontEnterButtonA2.setBackgroundResource(R.drawable.content_btn_font_enter_b);
				btnFontEnterColorBrown.setBackgroundResource(R.drawable.content_btn_color_brown);
				bookpagebg.setBackgroundResource(R.drawable.book_page_bg_horizontal);

				bcv.showColorBlack=2;
				bcv.showFontEnterButtona1=1;
				bcv.showFontEnterButtonA2=1;
			}else{
				((Button)v).setBackgroundResource(R.drawable.content_btn_color_black);
				bcv.showColorBlack=1;
			}
		}
		
	}




	public BtnColorBlackClick(BookContentView bcv,LinearLayout bookpagebg,
			Button btnFontEnterButtona1, Button btnFontEnterButtonA2,
			Button btnFontEnterColorBrown) {
		super();
		this.bcv = bcv;
		this.bookpagebg = bookpagebg;
		this.btnFontEnterButtona1 = btnFontEnterButtona1;
		this.btnFontEnterButtonA2 = btnFontEnterButtonA2;
		this.btnFontEnterColorBrown = btnFontEnterColorBrown;

	}
	
}
